import React, { Component } from 'react';
import { Text, View,StyleSheet,Alert,Button,TextInput,Dimensions,Image} from 'react-native';
import Geolocation from 'react-native-geolocation-service';
const width = Dimensions.get('window').width;
export default class Map extends Component {
    constructor(props){
        super(props);
        this.state = {

        }
    }
    render(){
        return (
            <View style={styles.container}>
                <Text>地图</Text>
            </View>
        );
    }
    // componentWillMount(){
    //     console.log(11111);
    // }
    componentDidMount(){
        alert(222);
        // if (hasLocationPermission) {
            Geolocation.getCurrentPosition(
                (position) => {
                    alert(1111);
                    console.log(position,"positionposition");
                },
                (error) => {
                    alert(3333,error.code, error.message);
                    // See error code charts below.
                    console.log(error.code, error.message);
                },
                { enableHighAccuracy: true, timeout: 15000, maximumAge: 10000 }
            );
        }
    // }

};
const styles = StyleSheet.create({
    container:{
        // position: 'relative',
        width:width,
        height:'100%'
    }

});